<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta charset="utf-8">
    <title>安全中心</title>
    <link href="/theme/hyzhongxin/css/geeteststyle.css" rel="stylesheet" type="text/css">
    <link href="/theme/hyzhongxin/css/personal_data.css" type="text/css" rel="stylesheet">
    <link href="/theme/hyzhongxin/css/newcommon_admin.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" href="/theme/hyzhongxin/css/style_https.css">
    <link rel="stylesheet" href="/theme/hyzhongxin/css/style_https.css">
    <script src="/theme/hyzhongxin/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<style>
    ins{
        display: none !important;
    }
</style>
<!---修改密码弹窗-->
<div id="Modify_password" style="display: none;">
    <div class="pop_up_bg"></div>
    <div class="password_cell">
        <form method="post" action="{{route('edit_pass',Auth::id())}}">
            {{ csrf_field() }}
            <div class="layer-cell-close"></div>
            <div class="input_title mb40 mt20">修改密码</div>
            <div class="mb10 input_text">旧密码<span>（请输入旧密码）</span></div>
            <input id="oldpwd" class="input_box" type="password" name="old_password" value="{{old('old_password')}}">
            <div class="mb10 input_text mt30">新密码<span>（密码长度6-20位）</span></div>
            <input id="ctl00_mainContent_txt_password" class="input_box" type="password" name="password" value="{{old('password')}}">
            <div class="mb10 input_text  mt30">确认新密码<span>（密码长度6-20位）</span></div>
            <input id="repeatpwd" class="input_box" type="password" name="repassword" value="{{old('repassword')}}">
            <button type="submit" class="input_sure mt45"> 确认修改</button>
        </form>
    </div>
</div>
<!---绑定手机号-->
<div id="Bound_phone" style="display: none;">
    <div class="pop_up_bg"></div>
    <div class="Bound_cell">
        <form method="post" action="{{ route('edit_mobile',Auth::id()) }}">
            {{csrf_field()}}
            <div class="layer-cell-close"></div>
            <div class="input_title mb40">绑定手机</div>
            <div class="mb10 input_text">手机号(请输入11位手机号码)</div>
            <input class="input_box" id="ctl00_mainContent_txt_phone" type="text" name="mobile" value="{{old('mobile')}}">
            <div class="mb10 input_text mt30">密码(账户密码)</div>
            <input class="input_box" id="chk_tel_pwd" type="password" name="password" value="{{old('password')}}">
            <div class="mb10 input_text mt30">验证码(请输入短信验证码)</div>
            <input class="input_validate fl" id="ctl00_mainContent_txt_code" type="text">
            <input class="input_validate input_validate01 fl ml10" value="获取验证码" id="origin_getcode"
                   style="display: none;" type="button"><input class="input_validate input_validate01 fl ml10"
                                                               value="获取验证码" id="getcode" type="button">
            <div class="clearfix"></div>
            <div style="margin: 20px auto;text-align: center;color: red;" id="errMsgBox">&nbsp;</div>
            <button type="submit" class="input_sure mt45" style="margin-top: 20px;"> 确认修改</button>
        </form>
    </div>
</div>
<!---绑定微信-->
<div id="Modify_wechat" style="display:none;">
    <div class="pop_up_bg"></div>
    <div class="wechat_cell">
        <div class="input_title mb50 mt10">绑定微信</div>
        <form method="post" action="{{route('edit_wechat',Auth::id())}}">
            {{csrf_field()}}
            <div class="fl">
                <div class="layer-cell-close"></div>
                @if(empty($user->mobile))
                    <div class="mb5 input_text  mt30">请先绑定手机号</div>
                @else
                    <div class="mb5 input_text  mt30">请输入微信号</div>
                    <input class="input_box" id="wxcode" type="text" name="wechat" value="{{old('wechat')}}">
                    <div class="mb5 input_text  mt30">请确认手机号</div>
                    <div class="input_box input_box01">@php
                            $phone = $user->mobile;
                echo substr($phone,0,3).'****'.substr($phone,-4);
                                @endphp</div>
                    <div class="mb5 input_text  mt30">请输入验证码</div>
                    <input class="input_validate fl" id="wxcheckcode" type="text">
                    <input class="input_validate input_validate01 fl ml10" id="wxg" value="获取验证码"
                           onclick="getcheckcode(1);" type="button">
                    <div class="clearfix"></div>
                    <button type="submit" class="input_sure mt45" > 确认绑定</button>
                @endif
            </div>
        </form>
        <div class="fl Alipay"><img src=""></div>
        <div class="clearfix"></div>
    </div>
</div>
<!---绑定银行卡-->
<div id="Modify_alipay" style="display:none;">
    <div class="pop_up_bg"></div>
    <div class="alipay_cell">
        <form method="post" action="{{route('bound_card',Auth::id())}}">
            {{ csrf_field() }}
            <div class="input_title mb30">绑定银行卡</div>
            <div class="fl">
                <div class="layer-cell-close"></div>
                <div class="mb5 input_text  mt30">银行卡卡号<span class="input_text_wran">(*请认真核对填写，不能有误)</span></div>
                <input class="input_box" id="bank_id" type="text" name="bank_id">
                <div class="mb5 input_text  mt30">银行卡户名<span class="input_text_wran">(*需匹配卡号，如张三)</span></div>
                <input class="input_box" id="bank_name" type="text" name="name">
                <div class="mb5 input_text mt10">银行</div>
                <select id="bank_from" class="input_box" name="bank_from">
                    <option value="">请选择银行</option>
                    <option value="ICBC">工商银行</option>
                    <option value="ABC">农业银行</option>
                    <option value="BOC">中国银行</option>
                    <option value="CCB">建设银行</option>
                    <option value="CMB">招商银行</option>
                    <option value="COMM">交通银行</option>
                    <option value="CITIC">中信银行</option>
                    <option value="CIB">兴业银行</option>
                    <option value="CEB">光大银行</option>
                    <option value="CMBC">民生银行</option>
                    <option value="PSBC">邮政储蓄银行</option>
                    <option value="BJBANK">北京银行</option>
                </select>

            </div>
            <div class="fl input_text_right">
                <div class="mb5 input_text">开户行<span class="ml5">*开户行可拨打银行客服电话查询</span></div>
                <input class="input_box" id="bank_area" placeholder="例：北京城东支行" type="text" name="bank_area">
                <div class="mb5 input_text mt30">请确认手机号</div>
                <div class="input_box input_box01"></div>
                <div class="input_box input_box02" style="display:none;">请绑定手机号</div>
                <div class="mb5 input_text  mt30">请输入验证码</div>
                <input class="input_validate fl" id="bankcheckcode" type="text">
                <input class="input_validate input_validate01 fl ml10" id="bank" value="获取验证码"
                       onclick="getcheckcode(3);" type="button">
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
            <input type="submit" class="input_sure input_sure_yinhangka mt45"> 确认绑定</input>
            <div class="input_sure_wran">*请认真填写银行卡信息，如因填写错误导致提现失败，一切损失将由个人承担。</div>
        </form>
    </div>
</div>
<!--修改银行卡弹窗-->
<div id="Modify_mobile" style="display: none;">
    <div class="pop_up_bg"></div>
    <div class="mobile_cell">
        <div class="layer-cell-close"></div>
        <div class="input_title mb50 mt40">修改银行卡</div>
        <div class="mobile_01">修改已绑定的银行卡请联系客服</div>
        <div class="mobile_02 mb40 mt20">（注意！客服不会索要您的密码）</div>
        <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=775121240&amp;site=qq&amp;menu=yes" target="_blank"><div class="input_sure mt45">联系客服</div></a>
    </div>
</div>
<!--left_column-->
@include('Home.left_column')
<!--left-column-end-->
<!--top-box-->
@include('Home.top_box')
<!---右边内容-->
<div id="Security_box" class="left_margin">
    <div class="Security_left">
        <div class="Security_title">安全中心</div>
        @if (session('msg'))
            <div class="alert alert-danger display-hide"  style="margin: 0 40%; display: block;">
                <button class="close" data-close="alert"></button>
                <span style="color: red; "> {{session('msg')}}</span>
            </div>
        @endif
        <div class="star_title_box" style="display: none;">
            <div class="fl star_title"> 账号安全级别:</div>
            <i class="icon_bg_02 fl ml20 star_01"></i>
            <i class="icon_bg_02 fl ml5 star_01"></i>
            <i class="icon_bg_02 fl ml5 star_04"></i>
            <i class="icon_bg_02 fl ml5 star_04"></i>
            <i class="icon_bg_02 fl ml5 star_04"></i>
            <div class="fl star_text01 ml15 star_text03" id="pointclass"><span>40</span>分</div>
            <div class="clearfix"></div>
        </div>
        <div class="user_name_box">
            <i class="icon_bg_02  user_name fl ml20"></i>
            <div class="fl  user_name_01">用户名:</div>
            <div class="fl  user_color" id="username">{{$user->u_name}}</div>
            <div class="clearfix"></div>
        </div>
        <div class="user_name_box">
            <i class="icon_bg_02  user_name01 fl ml20"></i>
            <div class="fl  user_name_01">登录密码:</div>
            <div class="fl user_color">***********</div>
            <div class="fr mr50 user_cousor user_cousor_01"> 修改</div>
            <div class="clearfix"></div>
        </div>
        <div class="user_name_box">
            <i class="icon_bg_02 user_name002 user_name02 fl ml20"></i>
            <div class="fl  user_name_01">手机号码:</div>
            <div class="fl user_color" id="telnum"></div>
            @if(empty($user->mobile))
                <div class="fl display_none display_none01" id="edittel"> 未绑定</div>
            @else
                <div class="fl user_color"> <?php $phone = $user->mobile;
                    echo substr($phone,0,3).'****'.substr($phone,-4);
                    ?></div>
                <div class="fr mr50 user_cousor display_none01" id="edittel1"> 修改</div>
            @endif
            <div class="clearfix"></div>
        </div>
        <div style="display: black;">
            <div class="user_name_box">
                <i class="icon_bg_02  user_name03  user_name003 fl ml20"></i>
                <div class="fl  user_name_01">微信:</div>
                @if(empty($user->wechat))
                    <div class="fl display_none display_none02" style="display:black;"> 未绑定</div>
                @else
                    <div class="fl user_color" style="display:black;"> {{$user->wechat}}</div>
                <div class="fl  user_color" style="display:none;"></div>
                <div class="fr mr50 user_cousor display_none02"> 修改</div>
                @endif
                <div class="clearfix"></div>
            </div>

            <div class="user_name_box">
                <i class="icon_bg_02  user_name04 fl user_name004 ml20"></i>
                <div class="fl  user_name_01">银行卡:</div>
                @if(empty($user->credit))
                    <div class="fl display_none display_none03" style="display: black;"> 未绑定</div>
                @else
                    <div class="fl user_color" style="display: black;"> @php
                        $bank = $user->credit;
                        echo substr($bank,0,4)."************".substr($bank,-3);
                    @endphp</div>
                <div class="fl user_color"></div>
                <div class="fr mr50 user_cousor user_cousor_02"> 修改</div>
                @endif
                <div class="clearfix"></div>
            </div>

            <div class="user_name_box  mb30">
                <i class="icon_bg_02  user_name05   fl ml20"></i>
                <div class="fl  user_name_01">身份证:</div>
                @if(empty($user->id_num))
                <div class="fl display_none  display_none04" > 未绑定</div>
                    <div class="mb5 input_text mt30">请输入身份证号</div>
                    <form>
                        <input class="input_box " name="id_num">
                        <button type="submit" class="input_sure mt45">确认</button>
                    </form>
                @else
                <div class="fl user_name_02 user_color" style="display:black;">***********</div>
                <div class="fr mr50" style="display:black;"> 身份已验证</div>
                <div class="clearfix"></div>
                @endif
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        var data = {};
           $('#bank_id').blur(function () {
                data.id = $('#bank_id').val();
                $.ajax({
                    headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
                    type:'post',
                    url:'{{route('get_card')}}',
                    data:data,
                    success:function (d) {
                        if (d.validated) {
                            var html = "<option value=\"" + d.bank + "\" selected>" + d.bankName + "</option>"
                            $('#bank_from').html(html);
                        }
                    }
                })
           }
        );
        $(function(){
            $(".user_cousor_01").click(function(){
                $("#Modify_password").show();
            });
            $(".layer-cell-close").click(function(){
                $("#Modify_password").hide();
            });
            $(".display_none01").click(function(){
                $("#Bound_phone").show();
            });
            $(".layer-cell-close").click(function(){
                $("#Bound_phone").hide();
            });
            $(".display_none02").click(function(){
                $("#Modify_wechat").show();
            });
            $(".layer-cell-close").click(function(){
                $("#Modify_wechat").hide();
            });
            $(".display_none03").click(function(){
                $("#Modify_alipay").show();
            });
            $(".layer-cell-close").click(function(){
                $("#Modify_alipay").hide();
            });
            $(".user_cousor_02").click(function(){
                $("#Modify_mobile").show();
            });
            $(".layer-cell-close").click(function(){
                $("#Modify_mobile").hide();
            });
        })
        function bindphone(){
            $("#Bound_phone").show();
        }
    });

</script>

<style type="text/css">
    #user_center_box{margin-top:0;}
    .content_center{background-color: #fff;margin:0 auto;width:52%;padding:5% 10% ;font-family: '微软雅黑';}
</style>
</body>
</html>